home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / afloat.zip / LDIV10.ASM < prev    next >
Assembly Source File  |  1988-03-16  |  721b  |  43 lines

  1.     PAGE   ,132
  2. ;-------------------------------------------------------
  3. ; LDIV10
  4. ;
  5. ; Copyright Bob Kline 1988
  6. ;
  7. ; Purpose:
  8. ;       divide doubleword value by 10
  9. ;
  10. ; Input:
  11. ;       DX:AX contain dividend on entry
  12. ;
  13. ; Output:
  14. ;       DX:AX contain quotient on exit
  15. ;       BX contains remainder (0 - 9)
  16. ;
  17. ; Other registers affected:
  18. ;    CX
  19. ;-------------------------------------------------------
  20.  
  21.         PUBLIC  LDIV10
  22.  
  23.     .MODEL SMALL
  24.  
  25.     .CODE
  26.  
  27. LDIV10  PROC
  28.  
  29.         MOV     CX,10
  30.         XCHG    DX,AX
  31.         PUSH    DX
  32.         XOR     DX,DX
  33.         DIV     CX
  34.         XCHG    AX,BX
  35.         POP     AX
  36.         DIV     CX
  37.         XCHG    BX,DX
  38.         RET
  39.  
  40. LDIV10  ENDP
  41.  
  42.         END
  43.